package core;

import java.util.Collections;
import java.util.List;

import gui.*;

import javax.swing.JFrame;

import dataStructures.QueryAndResults;

import xml.DirectoryReader;

public class Main {
	public static JFrame GUI = new JFrame();
	public static List<QueryAndResults> data;
	public static int rowSelected;
	public static DirectoryReader directoryReader;
		
	public static void displayMainFrame() {
		GUI = new MyMainFrame();
		GUI.setVisible(true);
	}
	
	public static void main(String[] args) {
		
		updateData();
		
		java.awt.EventQueue.invokeLater(new Runnable() {
			 
            public void run() {
        		displayMainFrame();
            }
        });
	}

	public static void updateData() {
		directoryReader = new DirectoryReader();
		data = directoryReader.getQueryAndResults();
		Collections.reverse(data); //recent search on top
	}
}